﻿<?php
require_once "common.php";
$pid=$_GET[pid];
if($pid!=""){
	@$part= new part($pid,'','');
	$partArray=$part->selectPart();
}
?>
<!doctype html>
<html style="overflow-y:scroll;">
	<head>
		<meta charset="utf-8" />
		<title>Default Examples</title>
		<style>
			form {
				margin: 0;
			}
			textarea {
				display: block;
			}
		</style>
		<script charset="utf-8" src="./editor/kindeditor-min.js"></script>
		<script charset="utf-8" src="./editor/lang/zh_CN.js"></script>
		<script>
			var editor;
			KindEditor.ready(function(K) {
				editor = K.create('textarea[name="content"]', {
					allowFileManager : true
				});
				K('input[name=getHtml]').click(function(e) {
					alert(editor.html());
				});
				K('input[name=isEmpty]').click(function(e) {
					alert(editor.isEmpty());
				});
				K('input[name=getText]').click(function(e) {
					alert(editor.text());
				});
				K('input[name=selectedHtml]').click(function(e) {
					alert(editor.selectedHtml());
				});
				K('input[name=setHtml]').click(function(e) {
					editor.html('<h3>Hello KindEditor</h3>');
				});
				K('input[name=setText]').click(function(e) {
					editor.text('<h3>Hello KindEditor</h3>');
				});
				K('input[name=insertHtml]').click(function(e) {
					editor.insertHtml('<strong>插入HTML</strong>');
				});
				K('input[name=appendHtml]').click(function(e) {
					editor.appendHtml('<strong>添加HTML</strong>');
				});
				K('input[name=clear]').click(function(e) {
					editor.html('');
				});
			});
		</script>
	</head>
	<body style="margin-top:15px;">
		<form action="./article_add.php" method="post">
			<p style="margin-top:0px;font-size:14px;font-family:Simsun;">标&nbsp&nbsp题：<input type="text" name="title" size=30/></p>
			<p style="margin-top:0px;font-size:14px;font-family:Simsun;">关键字：<input type="text" name="keyword" size=30/></p>
			<p style="margin-top:0px;font-size:14px;font-family:Simsun;">文章简介：<textarea name="describe" cols="97" rows="3" type="width:800px;height:100px;"></textarea></p>
			<p style="margin-top:0px;font-size:14px;font-family:Simsun;">栏&nbsp&nbsp目：<?php echo $partArray[part]; ?></p>
			<input type="hidden" name="part" value="<?php echo $partArray[pid]; ?>">
			<p style="margin-top:0px;font-size:14px;font-family:Simsun;">内容：<textarea name="content" style="width:800px;height:400px;visibility:hidden;"></textarea></p>
            <p>
            热门推荐<input type="checkbox" name="hot" value="1" />
            首页幻灯<input type="checkbox" name="slide_show" value="1" />
            </p>
			<div style="margin-right:100px;"><p style="align:right;"><input type="submit" name="submit" value="确认添加" /></p></div>
		</form>
	</body>
</html>
